<?php
require_once('inc/config.inc.php');
$songID = $_GET['songID'];
$hostName = $_COOKIE['hostName']==""?"1host":$_COOKIE['hostName'];
if ($hostName == "1host"){$connAddress = 1;}else{$connAddress = 2;}
$sql = "select address from kkyoo_music.tbl_song_address where id=".$connAddress;
$arr_catalogue = $conn->GetRow($sql);
$catalogue =	$arr_catalogue['address'];

$arrSongList[$i]['catalogue'] = $arrcatalogue;
if ($songID != "")
{
	$sql = "SELECT song.songID,song.songName,song.typeID,song.langID,song.trackID,song.mtvLast,song.lrcLast,song.catalogue,song.songSpell,singer.singerSpell,singer.singerName FROM kkyoo_music.tbl_song as song,kkyoo_music.tbl_song_singer as song_singer,kkyoo_music.tbl_singer as singer WHERE song.songID = song_singer.songID AND singer.singerID = song_singer.singerID AND song.songID=".$songID;
	$XMLstr = "";
	$XMLstr .= "<?xml version=\"1.0\" encoding=\"GB2312\"?>\n";
	$XMLstr .= "<songinfo>\n";
	if($result = $conn->Execute($sql)){
		while($arrRow = $result->FetchRow())
		{	
			$arrcatalogue = $catalogue.$arrRow['catalogue'];
			$XMLstr .="<song songId=\"".$arrRow['songID']."\" songName=\"".$arrRow['songName']."\" songSinger=\"".$arrRow['singerName']."\" songTypeId=\"".$arrRow['typeID']."\" songLangId=\"".$arrRow['langID']."\" songTrackId=\"".$arrRow['trackID']."\" songNameSpell=\"".$arrRow['songSpell']."\" songSingerSpell=\"".$arrRow['singerSpell']."\" mtvLast=\"".$arrRow['mtvLast']."\" lrcLast=\"".$arrRow['lrcLast']."\" songUrl=\"".$arrcatalogue."\" />\n";
		}
	}
	else{
		$XMLstr .="<song songID=\"0\">";
	}
	$XMLstr .= "</songinfo>\n";
	echo $XMLstr;
}
exit;